home *** CD-ROM | disk | FTP | other *** search
/ Especial Multimedia / Especial Multimedia.iso / Multimed / Herra / TIMWIN.ZIP / DEMO1.CMD < prev    next >
OS/2 REXX Batch file  |  1993-09-22  |  4KB  |  168 lines

  1. ;               TIM - DEMO                0
  2. ; TIMWIN Demo program 05/30/92       (c) TEA 1992
  3. ;
  4. ; The following variables are used:
  5. ; - imode
  6. ;    0     no win-images
  7. ; 1 - 4    Info for Win-images LUTs
  8. ;    16    use  16 colour win-images
  9. ;   256    use 256 colour win images 
  10. ; 0x400    use pop-up help (otherwise only @ F1)
  11. ;
  12. ;****************************************************
  13. int choice
  14. file timdemo = "timdemo.hlp"
  15. int imode
  16. int hmode = 1
  17. int config
  18. char message[128]
  19. string dtext = ""
  20. string htext = ""
  21. char naam[8]
  22. IMAGE winim
  23. int imnum=0
  24. int winattr = 0
  25.  
  26. dest p
  27. set update 0           ;no auto updating ibuf
  28.  
  29. *testcfg 1             ;1st time to initialise FG
  30. show p
  31. switch (config = *testcfg 1)    ;test configuration silently
  32.   case 0               ;if no frame grabber:
  33.     imode = 16         ;use 16-colour Windows image
  34.   case 6               ;if frame grabber in testconfig.
  35.     imode = 16         ;use 16-colour Windows image
  36.   case 15
  37.     imode = 0          ;frame grabber available
  38.   default
  39.     print (*testcfg)   ;test again, print report
  40.     pause
  41.     goto stop
  42. endsw
  43.  
  44. ;call fmessage   
  45.  
  46. *init
  47. *inilock
  48. ;pm:
  49. ;lcset standard
  50. help timdemo "demo program", hmode
  51.  
  52. repeat         ;repeat until ...
  53.  cls
  54.  *reset
  55.  print @8 @i "                     TIMWIN DEMO                            " @n @r
  56.  print @18 "Choose one of the following: " @n @r
  57.  print @8 "Stop (return to interactive mode) . . . . . . . . . . . 0" 
  58.  print @8 "Check system setup  . . . . . . . . . . . . . . . . . . 1"
  59.  print @8 "Define settings     . . . . . . . . . . . . . . . . . . 2" @r 
  60.  print @8 "Free running demos  . . . . . . . . . . . . . . . . . . 3"
  61.  print @8 "Free running floating point intensive demos . . . . . . 4"
  62.  print @8 "Real colour display demos . . . . . . . . . . . . . . . 5"
  63.  print @8 "Abingdon cross benchmark  . . . . . . . . . . . . . . . 6"
  64.  print @8 "Run Demos in Debug mode . . . . . . . . . . . . . . . . 7" @r
  65.  choice = "              Enter your choice . . . . . . . . . . . . . . .  "
  66.  
  67.  switch choice
  68.     case 1:
  69.       print (*testcfg 0)
  70.       pause
  71.     case 2:
  72.       call getconf
  73.     case 3:
  74.       *dfrd imode timdemo hmode
  75.     case 4:
  76.       *dfrdf imode timdemo hmode
  77.     case 5:
  78.       *dfrdcol imode timdemo hmode
  79.     case 6:
  80.       *dacross imode timdemo hmode
  81.     case 7: 
  82.       help timdemo "debug", hmode
  83.       debug                     ;continue in debug mode
  84.  endsw
  85. until choice == 0
  86.  
  87. stop:
  88. cls
  89. stop
  90.  
  91. getconf:
  92.  cls
  93.  
  94.  print @8 @i "               Specify configuration                     " @n @r
  95.  print @18 "Choose one of the following: " @n @r
  96.  print @8 "Ready  (back to the main menu) . . . . . . . . . . . . 0" @r
  97.  print @8 "Display on frame grabber . . . . . . . . . . . . . . . 1" 
  98.  print @8 "Display using Windows images ( 16 colours) . . . . . . 2" 
  99.  print @8 "Display using Windows images (256 colours) . . . . . . 3" @r
  100.  print @8 "Help pages pop up automatically  . . . . . . . . . . . 4" 
  101.  print @8 "Wait at new help page  . . . . . . . . . . . . . . . . 5"
  102.  print @8 "Help pages on request (F1) only  . . . . . . . . . . . 6" @r
  103.  choice = "                Enter your choice . . . . . . . . . . . . . . "
  104.  
  105. switch choice
  106.   case 1
  107.     if config != 15
  108.       pause "You specified a frame grabber, but you haven't got one!"
  109.     else
  110.       imode = 0
  111.       winattr = 0
  112.       call showwinims
  113.     endif
  114.   case 2
  115.     imode = 16
  116.     winattr = 1
  117.     call showwinims
  118.   case 3
  119.     imode = 256
  120.     winattr = 1
  121.     call showwinims
  122.   case 4
  123.     hmode = 2     ; 1024??
  124.   case 5
  125.     hmode = 1
  126.   case 6
  127.     hmode = 0
  128.   default
  129.     choice = 1    ;otherwise program stops
  130.     return
  131. endsw
  132.  
  133. ;call fmessage
  134.  
  135. goto getconf
  136.  
  137.  
  138. fmessage:
  139. switch imode
  140.   case 0
  141. ;    dtext = "FrGrabber only"
  142.   case 16
  143. ;    dtext = "Windows (16 grv)"
  144.   case 256
  145. ;    dtext = "Windows (256 grv)"
  146. endsw
  147.  
  148. switch hmode
  149.   case 1024
  150. ;    htext = "Auto help"
  151.   case 0
  152. ;    htext = "on request"
  153. endsw
  154.  
  155. ;fprint message "Image display: %s   Help: %s\n", dtext, htext
  156.  
  157. return
  158.  
  159. showwinims:         ;make all (256x256 sized) windows images visible
  160. repeat
  161.   fprint naam 0 "%s" (getim WIN_BIT (++imnum))  ;256x256 winbeeld
  162.   winim = naam
  163.   if  naam[0] != 0  show winim winattr
  164. until naam[0] == 0
  165. winattr = 0
  166. return
  167.  
  168.